{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "e0b92d07",
   "metadata": {},
   "source": [
    "## Addressing missing data issues"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "2855092b",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "from IPython.display import display\n",
    "from openbb import obb"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "bd8977ed",
   "metadata": {},
   "outputs": [],
   "source": [
    "obb.user.preferences.output_type = \"dataframe\""
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a791ae25",
   "metadata": {},
   "source": [
    "Fetches historical price data for the equity \"AAPL\" from 2020-07-01 to 2023-07-06 using the \"yfinance\" provider and stores it in 'df'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "8299ff63",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = obb.equity.price.historical(\n",
    "    \"AAPL\",\n",
    "    start_date=\"2020-07-01\",\n",
    "    end_date=\"2023-07-06\",\n",
    "    provider=\"yfinance\",\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "cac08bb6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>volume</th>\n",
       "      <th>split_ratio</th>\n",
       "      <th>dividend</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2020-07-01</th>\n",
       "      <td>91.279999</td>\n",
       "      <td>91.839996</td>\n",
       "      <td>90.977501</td>\n",
       "      <td>91.027496</td>\n",
       "      <td>110737200</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-02</th>\n",
       "      <td>91.962502</td>\n",
       "      <td>92.617500</td>\n",
       "      <td>90.910004</td>\n",
       "      <td>91.027496</td>\n",
       "      <td>114041600</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-06</th>\n",
       "      <td>92.500000</td>\n",
       "      <td>93.945000</td>\n",
       "      <td>92.467499</td>\n",
       "      <td>93.462502</td>\n",
       "      <td>118655600</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-07</th>\n",
       "      <td>93.852501</td>\n",
       "      <td>94.654999</td>\n",
       "      <td>93.057503</td>\n",
       "      <td>93.172501</td>\n",
       "      <td>112424400</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-08</th>\n",
       "      <td>94.180000</td>\n",
       "      <td>95.375000</td>\n",
       "      <td>94.089996</td>\n",
       "      <td>95.342499</td>\n",
       "      <td>117092000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-06-29</th>\n",
       "      <td>189.080002</td>\n",
       "      <td>190.070007</td>\n",
       "      <td>188.940002</td>\n",
       "      <td>189.589996</td>\n",
       "      <td>46347300</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-06-30</th>\n",
       "      <td>191.630005</td>\n",
       "      <td>194.479996</td>\n",
       "      <td>191.259995</td>\n",
       "      <td>193.970001</td>\n",
       "      <td>85069600</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-03</th>\n",
       "      <td>193.779999</td>\n",
       "      <td>193.880005</td>\n",
       "      <td>191.759995</td>\n",
       "      <td>192.460007</td>\n",
       "      <td>31458200</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-05</th>\n",
       "      <td>191.570007</td>\n",
       "      <td>192.979996</td>\n",
       "      <td>190.619995</td>\n",
       "      <td>191.330002</td>\n",
       "      <td>46920300</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-06</th>\n",
       "      <td>189.839996</td>\n",
       "      <td>192.020004</td>\n",
       "      <td>189.199997</td>\n",
       "      <td>191.809998</td>\n",
       "      <td>45094300</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>758 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                  open        high         low       close     volume  \\\n",
       "date                                                                    \n",
       "2020-07-01   91.279999   91.839996   90.977501   91.027496  110737200   \n",
       "2020-07-02   91.962502   92.617500   90.910004   91.027496  114041600   \n",
       "2020-07-06   92.500000   93.945000   92.467499   93.462502  118655600   \n",
       "2020-07-07   93.852501   94.654999   93.057503   93.172501  112424400   \n",
       "2020-07-08   94.180000   95.375000   94.089996   95.342499  117092000   \n",
       "...                ...         ...         ...         ...        ...   \n",
       "2023-06-29  189.080002  190.070007  188.940002  189.589996   46347300   \n",
       "2023-06-30  191.630005  194.479996  191.259995  193.970001   85069600   \n",
       "2023-07-03  193.779999  193.880005  191.759995  192.460007   31458200   \n",
       "2023-07-05  191.570007  192.979996  190.619995  191.330002   46920300   \n",
       "2023-07-06  189.839996  192.020004  189.199997  191.809998   45094300   \n",
       "\n",
       "            split_ratio  dividend  \n",
       "date                               \n",
       "2020-07-01          0.0       0.0  \n",
       "2020-07-02          0.0       0.0  \n",
       "2020-07-06          0.0       0.0  \n",
       "2020-07-07          0.0       0.0  \n",
       "2020-07-08          0.0       0.0  \n",
       "...                 ...       ...  \n",
       "2023-06-29          0.0       0.0  \n",
       "2023-06-30          0.0       0.0  \n",
       "2023-07-03          0.0       0.0  \n",
       "2023-07-05          0.0       0.0  \n",
       "2023-07-06          0.0       0.0  \n",
       "\n",
       "[758 rows x 7 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(df)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1a7b8dbc",
   "metadata": {},
   "source": [
    "Generates a date range from the minimum to maximum dates in 'df' with daily frequency and stores it in 'calendar_dates'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "4a736cd9",
   "metadata": {},
   "outputs": [],
   "source": [
    "calendar_dates = pd.date_range(start=df.index.min(), end=df.index.max(), freq=\"D\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "48d07162",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2020-07-01', '2020-07-02', '2020-07-03', '2020-07-04',\n",
       "               '2020-07-05', '2020-07-06', '2020-07-07', '2020-07-08',\n",
       "               '2020-07-09', '2020-07-10',\n",
       "               ...\n",
       "               '2023-06-27', '2023-06-28', '2023-06-29', '2023-06-30',\n",
       "               '2023-07-01', '2023-07-02', '2023-07-03', '2023-07-04',\n",
       "               '2023-07-05', '2023-07-06'],\n",
       "              dtype='datetime64[ns]', length=1101, freq='D')"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(calendar_dates)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "eb132f34",
   "metadata": {},
   "source": [
    "Reindexes 'df' to the 'calendar_dates', introducing missing values for non-trading days, and stores it in 'calendar_prices'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "241b3ad9",
   "metadata": {},
   "outputs": [],
   "source": [
    "calendar_prices = df.reindex(calendar_dates)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "814826df",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>volume</th>\n",
       "      <th>split_ratio</th>\n",
       "      <th>dividend</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2020-07-01</th>\n",
       "      <td>91.279999</td>\n",
       "      <td>91.839996</td>\n",
       "      <td>90.977501</td>\n",
       "      <td>91.027496</td>\n",
       "      <td>110737200.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-02</th>\n",
       "      <td>91.962502</td>\n",
       "      <td>92.617500</td>\n",
       "      <td>90.910004</td>\n",
       "      <td>91.027496</td>\n",
       "      <td>114041600.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-03</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-04</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-05</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-02</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-03</th>\n",
       "      <td>193.779999</td>\n",
       "      <td>193.880005</td>\n",
       "      <td>191.759995</td>\n",
       "      <td>192.460007</td>\n",
       "      <td>31458200.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-04</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-05</th>\n",
       "      <td>191.570007</td>\n",
       "      <td>192.979996</td>\n",
       "      <td>190.619995</td>\n",
       "      <td>191.330002</td>\n",
       "      <td>46920300.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-06</th>\n",
       "      <td>189.839996</td>\n",
       "      <td>192.020004</td>\n",
       "      <td>189.199997</td>\n",
       "      <td>191.809998</td>\n",
       "      <td>45094300.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1101 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                  open        high         low       close       volume  \\\n",
       "2020-07-01   91.279999   91.839996   90.977501   91.027496  110737200.0   \n",
       "2020-07-02   91.962502   92.617500   90.910004   91.027496  114041600.0   \n",
       "2020-07-03         NaN         NaN         NaN         NaN          NaN   \n",
       "2020-07-04         NaN         NaN         NaN         NaN          NaN   \n",
       "2020-07-05         NaN         NaN         NaN         NaN          NaN   \n",
       "...                ...         ...         ...         ...          ...   \n",
       "2023-07-02         NaN         NaN         NaN         NaN          NaN   \n",
       "2023-07-03  193.779999  193.880005  191.759995  192.460007   31458200.0   \n",
       "2023-07-04         NaN         NaN         NaN         NaN          NaN   \n",
       "2023-07-05  191.570007  192.979996  190.619995  191.330002   46920300.0   \n",
       "2023-07-06  189.839996  192.020004  189.199997  191.809998   45094300.0   \n",
       "\n",
       "            split_ratio  dividend  \n",
       "2020-07-01          0.0       0.0  \n",
       "2020-07-02          0.0       0.0  \n",
       "2020-07-03          NaN       NaN  \n",
       "2020-07-04          NaN       NaN  \n",
       "2020-07-05          NaN       NaN  \n",
       "...                 ...       ...  \n",
       "2023-07-02          NaN       NaN  \n",
       "2023-07-03          0.0       0.0  \n",
       "2023-07-04          NaN       NaN  \n",
       "2023-07-05          0.0       0.0  \n",
       "2023-07-06          0.0       0.0  \n",
       "\n",
       "[1101 rows x 7 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(calendar_prices)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0d6eb11e",
   "metadata": {},
   "source": [
    "Backfills missing values in 'calendar_prices' and stores the result in 'df_1'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "05b569f5",
   "metadata": {},
   "outputs": [],
   "source": [
    "df_1 = calendar_prices.bfill()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "74e2d64e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>volume</th>\n",
       "      <th>split_ratio</th>\n",
       "      <th>dividend</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2020-07-01</th>\n",
       "      <td>91.279999</td>\n",
       "      <td>91.839996</td>\n",
       "      <td>90.977501</td>\n",
       "      <td>91.027496</td>\n",
       "      <td>110737200.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-02</th>\n",
       "      <td>91.962502</td>\n",
       "      <td>92.617500</td>\n",
       "      <td>90.910004</td>\n",
       "      <td>91.027496</td>\n",
       "      <td>114041600.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-03</th>\n",
       "      <td>92.500000</td>\n",
       "      <td>93.945000</td>\n",
       "      <td>92.467499</td>\n",
       "      <td>93.462502</td>\n",
       "      <td>118655600.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-04</th>\n",
       "      <td>92.500000</td>\n",
       "      <td>93.945000</td>\n",
       "      <td>92.467499</td>\n",
       "      <td>93.462502</td>\n",
       "      <td>118655600.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-05</th>\n",
       "      <td>92.500000</td>\n",
       "      <td>93.945000</td>\n",
       "      <td>92.467499</td>\n",
       "      <td>93.462502</td>\n",
       "      <td>118655600.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-02</th>\n",
       "      <td>193.779999</td>\n",
       "      <td>193.880005</td>\n",
       "      <td>191.759995</td>\n",
       "      <td>192.460007</td>\n",
       "      <td>31458200.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-03</th>\n",
       "      <td>193.779999</td>\n",
       "      <td>193.880005</td>\n",
       "      <td>191.759995</td>\n",
       "      <td>192.460007</td>\n",
       "      <td>31458200.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-04</th>\n",
       "      <td>191.570007</td>\n",
       "      <td>192.979996</td>\n",
       "      <td>190.619995</td>\n",
       "      <td>191.330002</td>\n",
       "      <td>46920300.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-05</th>\n",
       "      <td>191.570007</td>\n",
       "      <td>192.979996</td>\n",
       "      <td>190.619995</td>\n",
       "      <td>191.330002</td>\n",
       "      <td>46920300.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-06</th>\n",
       "      <td>189.839996</td>\n",
       "      <td>192.020004</td>\n",
       "      <td>189.199997</td>\n",
       "      <td>191.809998</td>\n",
       "      <td>45094300.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1101 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                  open        high         low       close       volume  \\\n",
       "2020-07-01   91.279999   91.839996   90.977501   91.027496  110737200.0   \n",
       "2020-07-02   91.962502   92.617500   90.910004   91.027496  114041600.0   \n",
       "2020-07-03   92.500000   93.945000   92.467499   93.462502  118655600.0   \n",
       "2020-07-04   92.500000   93.945000   92.467499   93.462502  118655600.0   \n",
       "2020-07-05   92.500000   93.945000   92.467499   93.462502  118655600.0   \n",
       "...                ...         ...         ...         ...          ...   \n",
       "2023-07-02  193.779999  193.880005  191.759995  192.460007   31458200.0   \n",
       "2023-07-03  193.779999  193.880005  191.759995  192.460007   31458200.0   \n",
       "2023-07-04  191.570007  192.979996  190.619995  191.330002   46920300.0   \n",
       "2023-07-05  191.570007  192.979996  190.619995  191.330002   46920300.0   \n",
       "2023-07-06  189.839996  192.020004  189.199997  191.809998   45094300.0   \n",
       "\n",
       "            split_ratio  dividend  \n",
       "2020-07-01          0.0       0.0  \n",
       "2020-07-02          0.0       0.0  \n",
       "2020-07-03          0.0       0.0  \n",
       "2020-07-04          0.0       0.0  \n",
       "2020-07-05          0.0       0.0  \n",
       "...                 ...       ...  \n",
       "2023-07-02          0.0       0.0  \n",
       "2023-07-03          0.0       0.0  \n",
       "2023-07-04          0.0       0.0  \n",
       "2023-07-05          0.0       0.0  \n",
       "2023-07-06          0.0       0.0  \n",
       "\n",
       "[1101 rows x 7 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(df_1)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6a290601",
   "metadata": {},
   "source": [
    "Forward fills missing values in 'calendar_prices' and stores the result in 'df_1'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "ac6d5f14",
   "metadata": {},
   "outputs": [],
   "source": [
    "df_1 = calendar_prices.ffill()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "7bab66b5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>volume</th>\n",
       "      <th>split_ratio</th>\n",
       "      <th>dividend</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2020-07-01</th>\n",
       "      <td>91.279999</td>\n",
       "      <td>91.839996</td>\n",
       "      <td>90.977501</td>\n",
       "      <td>91.027496</td>\n",
       "      <td>110737200.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-02</th>\n",
       "      <td>91.962502</td>\n",
       "      <td>92.617500</td>\n",
       "      <td>90.910004</td>\n",
       "      <td>91.027496</td>\n",
       "      <td>114041600.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-03</th>\n",
       "      <td>91.962502</td>\n",
       "      <td>92.617500</td>\n",
       "      <td>90.910004</td>\n",
       "      <td>91.027496</td>\n",
       "      <td>114041600.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-04</th>\n",
       "      <td>91.962502</td>\n",
       "      <td>92.617500</td>\n",
       "      <td>90.910004</td>\n",
       "      <td>91.027496</td>\n",
       "      <td>114041600.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-05</th>\n",
       "      <td>91.962502</td>\n",
       "      <td>92.617500</td>\n",
       "      <td>90.910004</td>\n",
       "      <td>91.027496</td>\n",
       "      <td>114041600.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-02</th>\n",
       "      <td>191.630005</td>\n",
       "      <td>194.479996</td>\n",
       "      <td>191.259995</td>\n",
       "      <td>193.970001</td>\n",
       "      <td>85069600.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-03</th>\n",
       "      <td>193.779999</td>\n",
       "      <td>193.880005</td>\n",
       "      <td>191.759995</td>\n",
       "      <td>192.460007</td>\n",
       "      <td>31458200.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-04</th>\n",
       "      <td>193.779999</td>\n",
       "      <td>193.880005</td>\n",
       "      <td>191.759995</td>\n",
       "      <td>192.460007</td>\n",
       "      <td>31458200.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-05</th>\n",
       "      <td>191.570007</td>\n",
       "      <td>192.979996</td>\n",
       "      <td>190.619995</td>\n",
       "      <td>191.330002</td>\n",
       "      <td>46920300.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-06</th>\n",
       "      <td>189.839996</td>\n",
       "      <td>192.020004</td>\n",
       "      <td>189.199997</td>\n",
       "      <td>191.809998</td>\n",
       "      <td>45094300.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1101 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                  open        high         low       close       volume  \\\n",
       "2020-07-01   91.279999   91.839996   90.977501   91.027496  110737200.0   \n",
       "2020-07-02   91.962502   92.617500   90.910004   91.027496  114041600.0   \n",
       "2020-07-03   91.962502   92.617500   90.910004   91.027496  114041600.0   \n",
       "2020-07-04   91.962502   92.617500   90.910004   91.027496  114041600.0   \n",
       "2020-07-05   91.962502   92.617500   90.910004   91.027496  114041600.0   \n",
       "...                ...         ...         ...         ...          ...   \n",
       "2023-07-02  191.630005  194.479996  191.259995  193.970001   85069600.0   \n",
       "2023-07-03  193.779999  193.880005  191.759995  192.460007   31458200.0   \n",
       "2023-07-04  193.779999  193.880005  191.759995  192.460007   31458200.0   \n",
       "2023-07-05  191.570007  192.979996  190.619995  191.330002   46920300.0   \n",
       "2023-07-06  189.839996  192.020004  189.199997  191.809998   45094300.0   \n",
       "\n",
       "            split_ratio  dividend  \n",
       "2020-07-01          0.0       0.0  \n",
       "2020-07-02          0.0       0.0  \n",
       "2020-07-03          0.0       0.0  \n",
       "2020-07-04          0.0       0.0  \n",
       "2020-07-05          0.0       0.0  \n",
       "...                 ...       ...  \n",
       "2023-07-02          0.0       0.0  \n",
       "2023-07-03          0.0       0.0  \n",
       "2023-07-04          0.0       0.0  \n",
       "2023-07-05          0.0       0.0  \n",
       "2023-07-06          0.0       0.0  \n",
       "\n",
       "[1101 rows x 7 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(df_1)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9e21b651",
   "metadata": {},
   "source": [
    "Reindexes 'df' to the 'calendar_dates' and performs linear interpolation to fill missing values, storing the result in 'linear'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "736f0923",
   "metadata": {},
   "outputs": [],
   "source": [
    "calendar_prices = df.reindex(calendar_dates)\n",
    "linear = calendar_prices.interpolate(method=\"linear\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "df18e8ea",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>volume</th>\n",
       "      <th>split_ratio</th>\n",
       "      <th>dividend</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2020-07-01</th>\n",
       "      <td>91.279999</td>\n",
       "      <td>91.839996</td>\n",
       "      <td>90.977501</td>\n",
       "      <td>91.027496</td>\n",
       "      <td>1.107372e+08</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-02</th>\n",
       "      <td>91.962502</td>\n",
       "      <td>92.617500</td>\n",
       "      <td>90.910004</td>\n",
       "      <td>91.027496</td>\n",
       "      <td>1.140416e+08</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-03</th>\n",
       "      <td>92.096876</td>\n",
       "      <td>92.949375</td>\n",
       "      <td>91.299377</td>\n",
       "      <td>91.636248</td>\n",
       "      <td>1.151951e+08</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-04</th>\n",
       "      <td>92.231251</td>\n",
       "      <td>93.281250</td>\n",
       "      <td>91.688751</td>\n",
       "      <td>92.244999</td>\n",
       "      <td>1.163486e+08</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-05</th>\n",
       "      <td>92.365625</td>\n",
       "      <td>93.613125</td>\n",
       "      <td>92.078125</td>\n",
       "      <td>92.853750</td>\n",
       "      <td>1.175021e+08</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-02</th>\n",
       "      <td>193.063334</td>\n",
       "      <td>194.080002</td>\n",
       "      <td>191.593328</td>\n",
       "      <td>192.963338</td>\n",
       "      <td>4.932867e+07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-03</th>\n",
       "      <td>193.779999</td>\n",
       "      <td>193.880005</td>\n",
       "      <td>191.759995</td>\n",
       "      <td>192.460007</td>\n",
       "      <td>3.145820e+07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-04</th>\n",
       "      <td>192.675003</td>\n",
       "      <td>193.430000</td>\n",
       "      <td>191.189995</td>\n",
       "      <td>191.895004</td>\n",
       "      <td>3.918925e+07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-05</th>\n",
       "      <td>191.570007</td>\n",
       "      <td>192.979996</td>\n",
       "      <td>190.619995</td>\n",
       "      <td>191.330002</td>\n",
       "      <td>4.692030e+07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-06</th>\n",
       "      <td>189.839996</td>\n",
       "      <td>192.020004</td>\n",
       "      <td>189.199997</td>\n",
       "      <td>191.809998</td>\n",
       "      <td>4.509430e+07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1101 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                  open        high         low       close        volume  \\\n",
       "2020-07-01   91.279999   91.839996   90.977501   91.027496  1.107372e+08   \n",
       "2020-07-02   91.962502   92.617500   90.910004   91.027496  1.140416e+08   \n",
       "2020-07-03   92.096876   92.949375   91.299377   91.636248  1.151951e+08   \n",
       "2020-07-04   92.231251   93.281250   91.688751   92.244999  1.163486e+08   \n",
       "2020-07-05   92.365625   93.613125   92.078125   92.853750  1.175021e+08   \n",
       "...                ...         ...         ...         ...           ...   \n",
       "2023-07-02  193.063334  194.080002  191.593328  192.963338  4.932867e+07   \n",
       "2023-07-03  193.779999  193.880005  191.759995  192.460007  3.145820e+07   \n",
       "2023-07-04  192.675003  193.430000  191.189995  191.895004  3.918925e+07   \n",
       "2023-07-05  191.570007  192.979996  190.619995  191.330002  4.692030e+07   \n",
       "2023-07-06  189.839996  192.020004  189.199997  191.809998  4.509430e+07   \n",
       "\n",
       "            split_ratio  dividend  \n",
       "2020-07-01          0.0       0.0  \n",
       "2020-07-02          0.0       0.0  \n",
       "2020-07-03          0.0       0.0  \n",
       "2020-07-04          0.0       0.0  \n",
       "2020-07-05          0.0       0.0  \n",
       "...                 ...       ...  \n",
       "2023-07-02          0.0       0.0  \n",
       "2023-07-03          0.0       0.0  \n",
       "2023-07-04          0.0       0.0  \n",
       "2023-07-05          0.0       0.0  \n",
       "2023-07-06          0.0       0.0  \n",
       "\n",
       "[1101 rows x 7 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(linear)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "96ac3a88",
   "metadata": {},
   "source": [
    "Reindexes 'df' to the 'calendar_dates' and performs cubic spline interpolation to fill missing values, storing the result in 'cubic'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "237af015",
   "metadata": {},
   "outputs": [],
   "source": [
    "calendar_prices = df.reindex(calendar_dates)\n",
    "cubic = calendar_prices.interpolate(method=\"cubicspline\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "635e8973",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>volume</th>\n",
       "      <th>split_ratio</th>\n",
       "      <th>dividend</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2020-07-01</th>\n",
       "      <td>91.279999</td>\n",
       "      <td>91.839996</td>\n",
       "      <td>90.977501</td>\n",
       "      <td>91.027496</td>\n",
       "      <td>1.107372e+08</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-02</th>\n",
       "      <td>91.962502</td>\n",
       "      <td>92.617500</td>\n",
       "      <td>90.910004</td>\n",
       "      <td>91.027496</td>\n",
       "      <td>1.140416e+08</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-03</th>\n",
       "      <td>91.905178</td>\n",
       "      <td>93.018261</td>\n",
       "      <td>91.109728</td>\n",
       "      <td>91.804272</td>\n",
       "      <td>1.181507e+08</td>\n",
       "      <td>3.592598e-24</td>\n",
       "      <td>1.363686e-15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-04</th>\n",
       "      <td>91.628604</td>\n",
       "      <td>93.240770</td>\n",
       "      <td>91.492200</td>\n",
       "      <td>92.824548</td>\n",
       "      <td>1.213994e+08</td>\n",
       "      <td>7.185197e-24</td>\n",
       "      <td>2.727373e-15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-07-05</th>\n",
       "      <td>91.653353</td>\n",
       "      <td>93.483519</td>\n",
       "      <td>91.972948</td>\n",
       "      <td>93.555050</td>\n",
       "      <td>1.221227e+08</td>\n",
       "      <td>7.185197e-24</td>\n",
       "      <td>2.727373e-15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-02</th>\n",
       "      <td>194.071253</td>\n",
       "      <td>195.513330</td>\n",
       "      <td>192.326285</td>\n",
       "      <td>194.488423</td>\n",
       "      <td>5.806444e+07</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-2.115795e-21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-03</th>\n",
       "      <td>193.779999</td>\n",
       "      <td>193.880005</td>\n",
       "      <td>191.759995</td>\n",
       "      <td>192.460007</td>\n",
       "      <td>3.145820e+07</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-04</th>\n",
       "      <td>192.906895</td>\n",
       "      <td>193.224617</td>\n",
       "      <td>191.295466</td>\n",
       "      <td>191.403875</td>\n",
       "      <td>3.331034e+07</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>4.882604e-22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-05</th>\n",
       "      <td>191.570007</td>\n",
       "      <td>192.979996</td>\n",
       "      <td>190.619995</td>\n",
       "      <td>191.330002</td>\n",
       "      <td>4.692030e+07</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-06</th>\n",
       "      <td>189.839996</td>\n",
       "      <td>192.020004</td>\n",
       "      <td>189.199997</td>\n",
       "      <td>191.809998</td>\n",
       "      <td>4.509430e+07</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1101 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                  open        high         low       close        volume  \\\n",
       "2020-07-01   91.279999   91.839996   90.977501   91.027496  1.107372e+08   \n",
       "2020-07-02   91.962502   92.617500   90.910004   91.027496  1.140416e+08   \n",
       "2020-07-03   91.905178   93.018261   91.109728   91.804272  1.181507e+08   \n",
       "2020-07-04   91.628604   93.240770   91.492200   92.824548  1.213994e+08   \n",
       "2020-07-05   91.653353   93.483519   91.972948   93.555050  1.221227e+08   \n",
       "...                ...         ...         ...         ...           ...   \n",
       "2023-07-02  194.071253  195.513330  192.326285  194.488423  5.806444e+07   \n",
       "2023-07-03  193.779999  193.880005  191.759995  192.460007  3.145820e+07   \n",
       "2023-07-04  192.906895  193.224617  191.295466  191.403875  3.331034e+07   \n",
       "2023-07-05  191.570007  192.979996  190.619995  191.330002  4.692030e+07   \n",
       "2023-07-06  189.839996  192.020004  189.199997  191.809998  4.509430e+07   \n",
       "\n",
       "             split_ratio      dividend  \n",
       "2020-07-01  0.000000e+00  0.000000e+00  \n",
       "2020-07-02  0.000000e+00  0.000000e+00  \n",
       "2020-07-03  3.592598e-24  1.363686e-15  \n",
       "2020-07-04  7.185197e-24  2.727373e-15  \n",
       "2020-07-05  7.185197e-24  2.727373e-15  \n",
       "...                  ...           ...  \n",
       "2023-07-02  0.000000e+00 -2.115795e-21  \n",
       "2023-07-03  0.000000e+00  0.000000e+00  \n",
       "2023-07-04  0.000000e+00  4.882604e-22  \n",
       "2023-07-05  0.000000e+00  0.000000e+00  \n",
       "2023-07-06  0.000000e+00  0.000000e+00  \n",
       "\n",
       "[1101 rows x 7 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(cubic)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e43b61bc",
   "metadata": {},
   "source": [
    "**Jason Strimpel** is the founder of <a href='https://pyquantnews.com/'>PyQuant News</a> and co-founder of <a href='https://www.tradeblotter.io/'>Trade Blotter</a>. His career in algorithmic trading spans 20+ years. He previously traded for a Chicago-based hedge fund, was a risk manager at JPMorgan, and managed production risk technology for an energy derivatives trading firm in London. In Singapore, he served as APAC CIO for an agricultural trading firm and built the data science team for a global metals trading firm. Jason holds degrees in Finance and Economics and a Master's in Quantitative Finance from the Illinois Institute of Technology. His career spans America, Europe, and Asia. He shares his expertise through the <a href='https://pyquantnews.com/subscribe-to-the-pyquant-newsletter/'>PyQuant Newsletter</a>, social media, and has taught over 1,000+ algorithmic trading with Python in his popular course **<a href='https://gettingstartedwithpythonforquantfinance.com/'>Getting Started With Python for Quant Finance</a>**. All code is for educational purposes only. Nothing provided here is financial advise. Use at your own risk."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6e09199d-3879-4107-ac9f-02aaf381387e",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "jupytext": {
   "cell_metadata_filter": "-all",
   "main_language": "python",
   "notebook_metadata_filter": "-all"
  },
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
